<template>
  <a-card :bordered="false">
    <div class="content">
      <mms-wz-warehouse-stock-list v-if="currentTab === 0" @nextStep="nextStep"></mms-wz-warehouse-stock-list>
      <mms-wz-warehouse-stock-details-list :status="materFilter.status" :materialCode="materFilter.materialCode" :warehouseCode="materFilter.warehouseCode" v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep"></mms-wz-warehouse-stock-details-list>
    </div>
  </a-card>
</template>
<script>
  import MmsWzWarehouseStockList from './MmsWzWarehouseStockList'
  import MmsWzWarehouseStockDetailsList from './MmsWzWarehouseStockDetailsList'
  export default {
    name: 'MmsWzWarehouseStockMain',
    mixins: [],
    components: {
      MmsWzWarehouseStockList,
      MmsWzWarehouseStockDetailsList
    },
    data () {
      return {
        currentTab: 0,
        materFilter:{
          status: "",
          materialCode: "",
          warehouseCode: ""
        },
      }
    },
    methods: {
      // handler
      nextStep (filterObj) {
        this.materFilter.status = filterObj.status
        this.materFilter.materialCode = filterObj.materialCode
        this.materFilter.warehouseCode = filterObj.warehouseCode
        if (this.currentTab < 2) {
          this.currentTab += 1
        }
      },
      prevStep () {
        if (this.currentTab > 0) {
          this.currentTab -= 1
        }
      },
    },
  }
</script>